﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Autocomplete.aspx.cs" Inherits="demo.Pages.Autocomplete" %>

<%@ Register Assembly="Water" Namespace="Water.Web.Controls" TagPrefix="page" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <fieldset>
            <legend>高性能的Autocomplete</legend>
            <ul>
                <li>高性能的Autocomplete,对数据的读取进行了优化，避免了重复读取</li>
                <li>基于Water的多层应用框架</li>
                <li>可基自定义数据</li>
                <li>使用、设置简单</li>
                <li>控制灵活</li>
                <li>基于jquery.autocomplete的js脚本</li>
            </ul>
        </fieldset>
   
    <br />
    <page:Container ID="Container1" runat="server" TitleText="Autocomplete">
        <ItemTemplate>
            <page:Autocomplete ID="Autocomplete1" runat="server" 
            TypeName="demo.Objects.BLL.Regions" 
            ReturnTextField="REGIONNAME" 
            ReturnValueField="REGIONID" 
            MatchField="REGIONNAME" 
            Prompt="区域">
            </page:Autocomplete>
            <page:Autocomplete ID="Autocomplete2" runat="server" 
            TypeName="demo.Objects.BLL.Countries" 
            ReturnTextField="countryname" 
            ReturnValueField="countryid" 
            MatchField="COUNTRYNAME" 
            Prompt="国家(最多显示20条记录)" 
            SelectWidth="300" 
            Max="20">
            </page:Autocomplete>
            <page:Autocomplete ID="Autocomplete3" runat="server" 
            TypeName="demo.Objects.BLL.Departments" 
            ReturnTextField="departmentName"
            ReturnValueField="departmentId" 
            MatchField="departmentName" 
            Prompt="部门(不限制记录数,%可查询全部)" 
            SelectWidth="300" Max="0">
            </page:Autocomplete>
            <page:Autocomplete ID="Autocomplete4" runat="server" 
            TypeName="demo.Objects.BLL.Jobs" 
            ReturnTextField="title" 
            ReturnValueField="jobId" 
            MatchField="title" 
            Prompt="岗位(自定义显示格式)" 
            SelectWidth="400" 
            SelectHeight="300"
            Max="0"
           FormatItem="function aa(row,i,max) { return '<td>'+row.TITLE+'</td><td>'+row.JOBID+'</td><td>'+row.MINSALARY+'</td><td>'+row.MAXSALARY+'</td>';}">
           </page:Autocomplete>
            <page:Autocomplete ID="Autocomplete5" runat="server" 
            TypeName="demo.Objects.BLL.Employees" 
            ReturnTextField="NAME" 
            ReturnValueField="PROMPT" 
            MatchField="NAME" 
            Prompt="员工属性(指定方法)" 
            SelectWidth="400" 
            Max="0" 
            MethodName="GetSelf" >
            </page:Autocomplete>
        </ItemTemplate>
    </page:Container>
     </div>
    </form>
</body>
</html>
